package be.djdb.game.othello;

import java.awt.Color;
/**
* @author Lieven Roegiers
* @copyright 2012
* @from JAVA_othello
* @repos http://code.google.com/p/java-hogeschool-projecten/
*/
public class Settings {
	private  int blocksize = 42;
	private  Color speler1 = new Color(255,255,255);
	private  Color speler2 = new Color(1,1,1);
	private GameTypeEnum type = GameTypeEnum.MENS_MENS;
	private  int bordsizeX =12;
	private  int bordsizeY =12;
	public boolean setXSize(int size) throws OutOfRangeException {
		if(size<5){
			return false;
			//throw new OutOfRangeException();
		}
		if(16>size){
			return false;
			//throw new OutOfRangeException();
		}
		this.bordsizeX = size;
		return true;
	}
	public void setYSize(int size) throws OutOfRangeException {
		if(size<5){
			throw new OutOfRangeException();
		}
		if(16>size){
			throw new OutOfRangeException();
		}
		this.bordsizeY = size;
	}
	public void setblockSize(int size) throws OutOfRangeException {
		if(size>15){
			throw new OutOfRangeException();
		}
		if(100>size){
			throw new OutOfRangeException();
		}
		this.blocksize = size;
	}
	public Integer getbordsizeX(){
		return bordsizeX;
	}
	public Integer getbordsizeY(){
		return bordsizeY;
	}
	public Integer getblockSize(){
	   return blocksize;
	}
	public void setColorPlayer2(int r , int g , int b){
		speler1 = new Color(r,g,b);
	}
	public void setColorPlayer1(int r , int g , int b){
		speler2 = new Color(r,g,b);
	}
	public Color getColorPlayer1(){
		return speler1;
	}
	public Color getColorPlayer2(){
		return speler2;
	}
	public int getBlocksize() {
		return blocksize;
	}
	public void setBlocksize(int blocksize) {
		this.blocksize = blocksize;
	}
	public int getBordsizeX() {
		return bordsizeX;
	}
	public void setBordsizeX(int bordsizeX) {
		this.bordsizeX = bordsizeX;
	}
	public int getBordsizeY() {
		return bordsizeY;
	}
	public void setBordsizeY(int bordsizeY) {
		this.bordsizeY = bordsizeY;
	}
	public boolean isconsitent() {
		System.out.println("is blocksize null");
		if(blocksize==0){return false;}
		System.out.println("5> <16");
		if(bordsizeX>5 || 16>bordsizeX){return false;}
		System.out.println("5> <16");
		if(bordsizeY>5 || 16>bordsizeY){return false;}
		System.out.println("is type null");
		if(type == null){return false;}
		System.out.println("is speler null");
		if(speler1 == null){return false;}
		System.out.println("is speler null");
		if(speler2 == null){return false;}
		return true;
	}
	
}
